package com.soap.service.impl;

import com.soap.entity.po.Person;
import com.soap.manager.PersonManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * 代码示例
 */
 
@Component
public class CreateLog {
    @Autowired
    private PersonManager clmLogManageMapper;
    
    @Transactional(propagation = Propagation.REQUIRES_NEW)//加上这个注解可使日志插入不回滚
    public void createdLog(Person entity) {
        clmLogManageMapper.save(entity);//插入日志
    }
}